﻿using CuaHangLego.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Model
{
    public class HoaDonBan : HoaDon
    {
        public KhachHang KhachHang { get; set; }

        public HoaDonBan()
            : base()
        {
            this.DaThanhToan = false;
        }

        public HoaDonBan(int MaSo, KhachHang KhachHang, DateTime ThoiGian, IList<CTHD> DsCTHD, bool DaThanhToan)
            : base(MaSo, ThoiGian, DsCTHD, DaThanhToan)
        {
            this.KhachHang = KhachHang;
        }

        public HoaDonBan(int MaSo, KhachHang KhachHang, DateTime ThoiGian)
            : base(MaSo, ThoiGian)
        {
            this.KhachHang = KhachHang;
        }

        protected override IList<CTHD> GetCTHDs()
        {
            this.DsCTHD = CTHDBanDA.Instance.GetAllFromHD(this.MaSo);
            return this.DsCTHD;
        }
    }
}
